<?php
class mssql_db_driver {

    var $db;

    public function connect($host,$user,$pass) {
        $this->db = mssql_connect($host,$user,$pass);
        if(!$this->db) {
            return FALSE;
        }
        else {
            return TRUE;
        }

    }

    public function disconnect() {
        mssql_close($this->db);
    }

    public function select_db($dbName) {
        mssql_select_db($dbName);
    }

    public function query($qString) {
        $q = mssql_query($qString);
        return $q;
    }

    public function fetch_assoc($qResult) {
        $r = array();
        $r = mssql_fetch_assoc($r);
        return $r;
    }

    public function fetch_row($qResult) {
        $r = array();
        $r = mssql_fetch_row($qResult);
        return $r;
    }

    public function num_rows($qResult) {
        return mssql_num_rows($qResult);
    }

}

class metadb extends mssql_db_driver {

}

?>

